﻿//A company has name, address, phone number, fax number, web site and manager. The manager has first name, last name, age and a phone number. 
//Write a program that reads the information about a company and its manager and prints them on the console.

using System;

class PrintCompanyInformation
{
    static void Main()
    {
        //enter company information
        Console.WriteLine("Enter Company information:");
        Console.Write("Name: ");
        string companyName = Console.ReadLine();
        Console.Write("Address: ");
        string companyAddress = Console.ReadLine();
        Console.Write("Phone number: ");
        string companyPhoneNumber = Console.ReadLine();
        Console.Write("Fax number: ");
        string companyFaxNumber = Console.ReadLine();
        Console.Write("Web site: ");
        string companyWebSite = Console.ReadLine();
        //enter manager information
        Console.WriteLine("Enter Company Manager information:");
        Console.Write("First name: ");
        string managerFirstName = Console.ReadLine();
        Console.Write("Last name: ");
        string managerLastName = Console.ReadLine();
        Console.Write("Age: ");
        string managerAge = Console.ReadLine();
        Console.Write("Phone number: ");
        string managerPhoneNumber = Console.ReadLine();
        //print company information
        int lineSeparatorWidth = Math.Max((Console.WindowWidth / 2), companyName.Length);
        string doubleLineSeparator = new string('=', lineSeparatorWidth);
        Console.WriteLine(doubleLineSeparator);
        Console.WriteLine("{0," + ((lineSeparatorWidth / 2) + (companyName.Length / 2)) + "}", companyName.ToUpper());
        string singleLineSeparator = new string('-', lineSeparatorWidth);
        Console.WriteLine(singleLineSeparator);
        Console.WriteLine(" Address: {0}", companyAddress);
        Console.WriteLine("   Phone: {0,-13:(###) ### #### #####}", companyPhoneNumber);
        Console.WriteLine("    Fax : {0,-13:(###) ### #### #####}", companyFaxNumber);
        Console.WriteLine("Web site: {0}", companyWebSite);
        //print manager information
        Console.WriteLine(singleLineSeparator);
        Console.WriteLine("  Manager");
        Console.WriteLine("    Name: {0} {1}", managerFirstName, managerLastName);
        Console.WriteLine("     Age: {0:N3}", managerAge);
        Console.WriteLine("   Phone: {0:(###) ### #### #####}", managerPhoneNumber);
        Console.WriteLine(doubleLineSeparator);
    }
}
